package com.example.zxw.greendao

import android.content.Context
import com.example.zxw.CnsApplication


object GreenDaoManager {
    const val DB_NAME = "CnsDb.db"

    lateinit var daoSession: DaoSession
    fun init() {
        val myOpenHelper = MyOpenHelper(CnsApplication.applicationContext, DB_NAME)
        val database = myOpenHelper.writableDatabase
        val daoMaster = DaoMaster(database)
        daoSession = daoMaster.newSession()
    }
}

class MyOpenHelper(context: Context, name: String) : DaoMaster.OpenHelper(context, name)